package com.peas.platform.module.icims.base.auth.adapter.repository.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.peas.platform.common.core.annotation.Comment;
import com.peas.platform.framework.mybatisplus.po.BasePo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;

// 用户
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`tbl_user`")
public class UserPo extends BasePo {

    // 用户名
    @Comment(value = "用户名")
    @NotBlank(message = "用户名不能为空")
    @Size(max = 30, message = "用户名不能超过30个字符")
    @TableField(value = "`username`", jdbcType = JdbcType.VARCHAR)
    private String username;

    // 密码
    @Comment(value = "密码")
    @NotBlank(message = "密码不能为空")
    @Size(max = 100, message = "密码不能超过100个字符")
    @TableField(value = "`password`", jdbcType = JdbcType.VARCHAR)
    private String password;

    // 状态
    // 枚举取值:UserState
    @Comment(value = "状态", enumType = "UserState")
    @NotBlank(message = "状态不能为空")
    @Size(max = 20, message = "状态不能超过20个字符")
    @TableField(value = "`state`", jdbcType = JdbcType.VARCHAR)
    private String state;

    // 是否管理员
    // 枚举取值:CommonYesNo
    @Comment(value = "是否管理员", enumType = "CommonYesNo")
    @Size(max = 20, message = "是否管理员不能超过20个字符")
    @TableField(value = "`is_manager`", jdbcType = JdbcType.VARCHAR)
    private String isManager;

    // 是否强制修改密码
    // 枚举取值:CommonYesNo
    @Comment(value = "是否强制修改密码", enumType = "CommonYesNo")
    @Size(max = 20, message = "是否强制修改密码不能超过20个字符")
    @TableField(value = "`need_modify`", jdbcType = JdbcType.VARCHAR)
    private String needModify;

    // 最后一次登录时间
    @Comment(value = "最后一次登录时间")
    @TableField(value = "`last_login_time`", jdbcType = JdbcType.TIMESTAMP)
    private Date lastLoginTime;

    // 最后一次登录IP
    @Comment(value = "最后一次登录IP")
    @Size(max = 15, message = "最后一次登录IP不能超过15个字符")
    @TableField(value = "`last_login_ip`", jdbcType = JdbcType.VARCHAR)
    private String lastLoginIp;

    // 姓名
    @Comment(value = "姓名")
    @Size(max = 20, message = "姓名不能超过20个字符")
    @TableField(value = "`name`", jdbcType = JdbcType.VARCHAR)
    private String name;

    // 性别
    // 枚举取值:UserGender
    @Comment(value = "性别", enumType = "UserGender")
    @Size(max = 20, message = "性别不能超过20个字符")
    @TableField(value = "`gender`", jdbcType = JdbcType.VARCHAR)
    private String gender;

    // 手机号码
    @Comment(value = "手机号码")
    @Size(max = 15, message = "手机号码不能超过15个字符")
    @TableField(value = "`mobile`", jdbcType = JdbcType.VARCHAR)
    private String mobile;

    // 身份证号
    @Comment(value = "身份证号")
    @Size(max = 18, message = "身份证号不能超过18个字符")
    @TableField(value = "`idcard`", jdbcType = JdbcType.VARCHAR)
    private String idcard;

    // 邮箱
    @Comment(value = "邮箱")
    @Size(max = 50, message = "邮箱不能超过50个字符")
    @TableField(value = "`email`", jdbcType = JdbcType.VARCHAR)
    private String email;

    // 头像
    @Comment(value = "头像")
    @TableField(value = "`avatar`", jdbcType = JdbcType.VARCHAR)
    private Long avatar;

    // 组织架构ID
    // （组织架构表）外键
    @Comment(value = "组织架构ID")
    @TableField(value = "`organization_id`", jdbcType = JdbcType.BIGINT)
    private Long organizationId;

    // 职级
    // 字典取值:UserRank
    @Comment(value = "职级", dictType = "UserRank")
    @Size(max = 20, message = "职级不能超过20个字符")
    @TableField(value = "`rank`", jdbcType = JdbcType.VARCHAR)
    private String rank;

    // 签名图
    @Comment(value = "签名图")
    @TableField(value = "`sign`", jdbcType = JdbcType.VARCHAR)
    private Long sign;

}
